/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dirstat;

import java.io.File;
import java.util.Comparator;
import java.util.Map;

/**
 *
 * @author felipe
 */
public class DirectoryComparator implements Comparator<File> {

    private Map<File, Long> directories;
    
    public DirectoryComparator( Map<File, Long> directories) {
        
        this.directories = directories;
        
    }
    
    @Override
    public int compare(File o1, File o2) {
        
        Long result = directories.get( o2) - directories.get( o1);
        return result.intValue();
        
    }
    
}
